<?php

namespace app\admin\controller;

use app\admin\model\Category;
use think\facade\Db;
use think\facade\View;
class Goods
{
    public function cate()
    {
        $id=request()->get('id','0');

        $list=Category::getCateList($id);
        View::assign("list",$list);

        $top=Category::getPar();
        View::assign('top',$top);
        return view();
    }

    public function goodAdd()
    {
        return view();
    }

    public function goodEdit()
    {
        return view();
    }

    public function goodList()
    {
        // 模糊搜索展示
        list($where,$order)=\app\admin\logic\Goods::getGoodListWhere();
        $all=\app\admin\model\Goods::getGoodsList($where,$order);
        $all=$all->select();
        View::assign('all',$all);

        //
        $list3=input('');
        unset($list3['order']);
        View::assign('list3',$list3);
        View::assign($list3);


        $top=Category::getPar();
        View::assign('top',$top);

        $list=Category::getCateList(0);
        View::assign("list",$list);
        return view();
    }
}